/**
 * 
 */
package any.desktop.server;

import java.io.IOException;
import java.net.URI;
import java.util.Iterator;
import java.util.List;

import org.apache.lucene.document.Document;

import any.desktop.FileItem;

/**
 * @author keke<keke@codehaus.org>
 * @version 0.0.1
 * @revision $Revision: 70 $
 */
public interface DesktopService {
	/**
	 * TODO: doc me
	 * 
	 * @throws IOException
	 */
	void crawlComplete() throws IOException;

	/**
	 * TODO: doc me
	 * 
	 * @return
	 */
	List<URI> getCrawlRoots();

	FileItem getFileItem(String id);

	/**
	 * TODO: doc me
	 * 
	 * @param item
	 * @return
	 * @throws IOException
	 * @throws IndexException
	 */
	DesktopService index(URI item) throws IOException, IndexException;

	/**
	 * TODO: doc me
	 * 
	 * @param query
	 * @param start
	 * @param length
	 * @return
	 * @throws IOException
	 */
	Iterator<Document> search(String query, int start, int length)
	        throws IOException;
}
